package com.qf.rabbitmq2203.ex;

import cn.hutool.extra.mail.MailUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

@ControllerAdvice
public class MyException {

    @ExceptionHandler(value = Exception.class )
    public void error(Exception ex){

        System.out.println(ex.getMessage());

        MailUtil.send("527436383@qq.com", "测试", "邮件来自Hutool测试", false);

    }

}
